//柱状图通用
const barConfig = {
  legend: {
    show: false,
    x: "",
    y: "",
  },
  titleColor:"#333333",
  titleTop: 0,
  title: '',
  xAxisData: [],
  tooltip: {
    show: true
  },
  yAxis: {
    name: "",
    type: "value",
    grainUnit: "%",
    show: true,
    gridShow: true,
    splitLineShow: true,
  },
  xPosition: "",
  gridTop: '35px',
  barWidth: 10,
  gridBottom: '50px',
  right: '20px',
  left: '40px',
  list: [{
    name: '',
    type: 'bar',
    barWidth: 10,
    label: {
      show: true, //开启显示
      position: 'top', //在上方显示
      textStyle: { //数值样式
        color: '#3384FE',
        fontSize: 12
      },
      formatter: '{c}%'
    },
    itemStyle: {
      normal: {
        color: function (params) {
          let color = params.value > 0 ? "#3384fe" : "#FF7A81"
          return color
        }
      }
    },
    data: [],
  }],
  dataZoom: true
}

//饼状图通用
const pieConfig = {
  color: [],
  legend: {
    show: true,
    width: 500,
    // height:250,
    top: 'center',
    // left:270,
    // radius:['40%', '50%'],
    // center:[100, '50%'],
  },
  seriesName: "",
  title: "",
  list: []
}

//折线图
const lineConfig = {
  color: ['#3384fe'],
  legend: {
    show: false,
  },
  title: '',
  tooltip: {
    show: true
  },
  xAxis: {
    xAxisData: [],
    show: true,
    axisTickShow: true,
    axisTickLength: 270
  },
  yAxis: {
    name: "",
    type: "value",
    grainUnit: "%",
    show: true,
    splitLineShow: true
  },
  dataZoom: true,
  isXAxisDataName: '',
  gridTop: '35px',
  gridBottom: '50px',
  right: '20px',
  left: '40px',
  list: [{
    type: 'line',
    smooth: true,
    itemStyle: {
      color: '#3384FE',
      normal: {
        label: {
          show: true,
          position: 'top',
          textStyle: {
            color: '#3384FE',
            fontSize: 14
          },
          formatter: '{c}%' //折线图上显示的文字
        }
      }
    },
    data: []
  }]
}

//资产地图财务表现柱状图通用
const barMapFinanceConfig = {
  legend: {
    show: true,
    x: "center",
    y: "top",
    data: ["总体估值", "年累计毛收入", "年累计净运营收入"]
  },
  color: ['#F79100', '#D1E3FF', '#3384FE'],
  title: '',
  xAxisData: [],
  tooltip: {
    show: true
  },
  yAxis: {
    name: "",
    type: "value",
    grainUnit: "",
    show: false,
  },
  gridTop: '35px',
  barWidth: 10,
  gridBottom: '50px',
  right: '20px',
  left: '40px',
  list: [{
    name: '总体估值',
    type: 'bar',
    barWidth: 10,
    label: {
      show: true, //开启显示
      position: 'top', //在上方显示
      textStyle: { //数值样式
        color: '#F79100',
        fontSize: 12
      },
      formatter: '{c}'
    },
    data: []
  }, {
    name: '年累计毛收入',
    type: 'bar',
    barWidth: 10,
    label: {
      show: true, //开启显示
      position: 'top', //在上方显示
      textStyle: { //数值样式
        color: '#D1E3FF',
        fontSize: 12
      },
      formatter: '{c}'
    },
    data: []
  }, {
    name: '年累计净运营收入',
    type: 'bar',
    barWidth: 10,
    label: {
      show: true, //开启显示
      position: 'top', //在上方显示
      textStyle: { //数值样式
        color: '#3384FE',
        fontSize: 12
      },
      formatter: '{c}'
    },
    data: []
  }],
  dataZoom: true
}

export {
  barConfig,
  pieConfig,
  lineConfig,
  barMapFinanceConfig
}
